import { getAllUser } from '@/api/system/user'

const alluser = {
  state: {
    list: []
  },

  mutations: {
    SET_LIST: (state, list) => {
      state.list = list
    }
  },

  actions: {
    // 获取人员信息
    GetAllUser({ commit, state }) {
      return new Promise((resolve, reject) => {
        getAllUser().then(res => {
          const list = res.data;      
          commit('SET_LIST', list)
          resolve(res)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default alluser
